<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%
	 String path = request.getContextPath();
	 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
 	%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css"
	href="/bsc/static/common/bootstrap/css/bootstrap.min.css" />
<script src="/bsc/static/js/jquery-3.1.1.js" type="text/javascript"
	charset="utf-8"></script> 
<script
	src="/bsc/static/common/bootstrap/js/bootstrap-3.3.7-dist/js/bootstrap.min.js"
	type="text/javascript" charset="utf-8"></script>
<script 
	src="/bsc/static/common/bootstrap/js/bootstarp-table-1.11.1/bootstrap-table.min.js"
	type="text/javascript" charset="utf-8"></script>
<script
	src="/bsc/static/common/bootstrap/js/bootstarp-table-1.11.1/bootstrap-table-zh-CN.min.js"
	type="text/javascript" charset="utf-8"></script> 
<link rel="stylesheet" type="text/css"
	href="../static/common/global.css" media="all">
 <link rel="stylesheet" type="text/css" href="../static/css/personal.css"
	media="all">
	<link rel="stylesheet" type="text/css"
	href="/bsc/static/common/layui/css/layui.css" media="all">
</head>
<script type="text/javascript">
  $(document).ready(function(){
		$("#btn").click(function(){//绑定
			document.forms[0].action="/bsc/biswechat/list";//跳转
			document.forms[0].submit();
			 
		});
		$("#btn2").click(function(){//绑定
			document.forms[0].action="/bsc/biswechat/list2";//跳转
			document.forms[0].submit();
		});
		$("#xg").change(function(){
			$.ajax({
				type:"post",
				url:'<%=basePath%>biswechat/select',
				data:{custom_user_id:$("#xg").val()},
				dataType:"json",
				success:function(msg){
					 $("#mobile").val(msg.mobile);
				}
			})
		})
		
	});
  </script>
</head>
<body>
<section class="layui-larry-box">
<blockquote class="layui-elem-quote news_search">
<form  method="post" id="formName" action="<%=basePath%>/biswechat/save" onsubmit="return check()">
				发送信息
		</blockquote>	
			<table class="table-hover table-condensed table-bordered" width="60%">
				<%-- <tr>
					<td>发送用户:</td>
					<td>
					<select style="min-width: 200px;min-height:35px;font-style:bold;" id="xg" name="bis_custom_user.custom_user_id">
					<option value="-1">请选择用户</option>
					<c:forEach items="${list}" var="wechat">
					<option value="${wechat.custom_user_id }" >${wechat.username}</option>
					</c:forEach>
					</select>
					</td>
				</tr>
				<tr>
				<td>手机号:</td>
				<td><input type="text" id="mobile" name="mobile" style="width:200px;height:30px;font-style:bold" class="form-control"  readonly="readonly"></td>
				</tr>
				<tr>
					<td>内容：</td>
					<td><textarea rows="5" cols="50"  placeholder="请输入发送内容" id="content" name="content"></textarea></td>
				</tr> --%>
				<input type="button" value="选择用户" id="btn2" class="btn btn-primary" style="height: 35px;"/>
				<tr>
				<td >发送用户:</td>
				<td><textarea rows="3" cols="45" id="openids" name="mobile">${userids }</textarea></td>
				</tr>
				<tr>
				<td><input type="hidden" name="openid" value="${openids }"/></td>
				</tr>
				<tr>
					<td>内容：</td>
					<td><textarea rows="5" cols="50" placeholder="请输入发送内容" id="content" name="content"></textarea></td>
				</tr>
			</table>
		 <input type="submit" value="发送信息" class="btn btn-info" style="height: 35px;">
			<input type="button" value="关&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;闭" id="btn" class="btn btn-danger" style="height: 35px;"/>
	</form>
	</section>
	<script type="text/javascript">
	function check(){
		var mobile=$("#mobile").val();
		var content=$("#content").val();
// 		console.log(content);
		/* if(mobile==null||mobile==""){
			alert("请选择用户!");
			return false;
		} */
		if(content==null||content==""){
			alert("请输入发送内容!");
			return false;
		}
		return true;
	}
	</script>
</body>
</html>